package org.github.manx98.jlibhac.ns;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/5 16:20
 */
public enum Language {
    AmericanEnglish,
    BritishEnglish,
    Japanese,
    French,
    German,
    LatinAmericanSpanish,
    Spanish,
    Italian,
    Dutch,
    CanadianFrench,
    Portuguese,
    Russian,
    Korean,
    TraditionalChinese,
    SimplifiedChinese,
    BrazilianPortuguese;

    public static Language valueOf(int i) {
        for (Language value : values()) {
            if (value.ordinal() == i) return value;
        }
        throw new IllegalArgumentException("Invalid Language value: " + i);
    }

    public static Language formName(String name) {
        switch (name){
            case "Taiwanese":
                return TraditionalChinese;
            case "Chinese":
                return SimplifiedChinese;
            default:
                return valueOf(name);
        }
    }
}
